/**
 * 用户列表
 */
"use client";
import { IUser } from "@/type/user";
import { Button, Space, Table, TableProps } from "antd";
import { useCallback, useState } from "react";

const UserList = () => {
  const [listData, setListData] = useState<IUser[]>([]);
  const listFun = useCallback(
    async () => {
      
    },
    [],
  )
  
  const columns: TableProps<IUser>["columns"] = [
    {
      title: "序号",
      dataIndex: "index",
      render: (_, record, index) => index + 1,
    },
    {
      title: "姓名",
      dataIndex: "name",
    },
    {
      title: "年龄",
      dataIndex: "age",
    },

    {
      title: "操作",
      render: (_, record) => (
        <Space size="middle">
          <Button>编辑</Button>
          <Button>删除</Button>
        </Space>
      ),
    },
  ];
  return (
    <div>
      <div>
        <Button>添加用户</Button>
      </div>
      <Table<IUser> columns={columns} dataSource={listData} />
    </div>
  );
};
export default UserList;
